package org.unit.testmgmt.custom;

import java.util.List;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.unit.testmgmt.generator.TestClassGenerator;
import org.unit.testmgmt.tml.Param;
import org.unit.testmgmt.tml.Settings;
import org.unit.testmgmt.tml.Test;
import org.unit.testmgmt.tml.TestBase;

/**
 * Customizes a test class generator.
 * 
 * @author Robert Streng
 *
 */
public class TestClassGeneratorCustom extends TestClassGenerator {

	public TestClassGeneratorCustom() {
	}
	
	@Override
	protected void createStandardClassFields(IType type, Test tmlTest, String testclassName)
			throws JavaModelException {
		super.createStandardClassFields(type, tmlTest, testclassName);
	}
	
	@Override
	protected void createStandardMethods(IType type, Settings tmlSettings)
			throws JavaModelException {
		super.createStandardMethods(type, tmlSettings);
	}
	
	@Override
	protected IType createTestClassFrame(ICompilationUnit testCompilationUnit, Test tmlTest,
			String testclassName, String source) throws JavaModelException {
		IType testClassFrame = super.createTestClassFrame(testCompilationUnit, tmlTest, testclassName, source);
		return testClassFrame;
	}
	
	@Override
	protected String getTestClassComment() {
		return "/** Test class comment */";
	}
	
	@Override
	protected String createTestBaseMethodBody(TestBase tmlTestbase, String testBaseName,
			String testBaseMethodName, List<Param> params, Settings tmlSettings) {
		String testBaseMethodbody = super.createTestBaseMethodBody(tmlTestbase, testBaseName, testBaseMethodName, params,
				tmlSettings);
		
		return "String variable; " + RETURN + testBaseMethodbody;
	}
}
